package com.qf.springboot.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 接收参数
 * @author zjw
 */
public class AirDTO {

    /**
     * 区域主键
     */
    @NotNull(message = "区域主键为必填项，岂能为空！")
    private Integer districtId;

    /**
     * 检测时间
     */
    @NotNull(message = "检测时间为必填项，岂能为空！")
    @ApiModelProperty(example = "2011-11-11")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date monitorTime;

    /**
     * pm10值
     */
    @NotNull(message = "pm10值为必填项，岂能为空！")
    @Max(value = 1000,message = "pm10超过最大值，应当小于1000！")
    private Integer pm10;

    /**
     * pm2.5值
     */
    @NotNull(message = "pm2.5值为必填项，岂能为空！")
    @Min(value = 10,message = "pm2.5的值，就没有小于10的！")
    private Integer pm25;

    /**
     * 检测站
     */
    @NotBlank(message = "检测站为必填项，岂能为空！")
    private String monitoringStation;

    @Override
    public String toString() {
        return "AirDTO{" +
                "districtId=" + districtId +
                ", monitorTime=" + monitorTime +
                ", pm10=" + pm10 +
                ", pm25=" + pm25 +
                ", monitoringStation='" + monitoringStation + '\'' +
                '}';
    }

    public Integer getDistrictId() {
        return districtId;
    }

    public void setDistrictId(Integer districtId) {
        this.districtId = districtId;
    }

    public Date getMonitorTime() {
        return monitorTime;
    }

    public void setMonitorTime(Date monitorTime) {
        this.monitorTime = monitorTime;
    }

    public Integer getPm10() {
        return pm10;
    }

    public void setPm10(Integer pm10) {
        this.pm10 = pm10;
    }

    public Integer getPm25() {
        return pm25;
    }

    public void setPm25(Integer pm25) {
        this.pm25 = pm25;
    }

    public String getMonitoringStation() {
        return monitoringStation;
    }

    public void setMonitoringStation(String monitoringStation) {
        this.monitoringStation = monitoringStation;
    }
}
